home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-04-03 | 8.6 KB | 186 lines | [TEXT/pdos] |
- Apple II
- Technical Notes
- _____________________________________________________________________________
- Developer Technical Support
-
- AppleTalk
- #4: Printing Through the Firmware
-
- Revised by: Jim Luther March 1990
- Written by: Matt Deatherage & Jim Luther July 1989
-
- This Technical Note discusses considerations of printing through the AppleTalk
- firmware in transparent mode.
- Changes since September 1989: Modified to suggest that Network Printer be
- added to the printer slot choices and revised CheckATalk code sample to work
- correctly with the ROM 03 Apple IIGS.
- _____________________________________________________________________________
-
- The AppleShare Programmer's Guide to the Apple IIGS states that printing in
- transparent mode (through Super Serial Card emulation for older applications
- which don't know about AppleTalk) is initiated when you do a PR#7 command.
-
- This statement is pretty short-sighted. It's much like saying printing
- through an ImageWriter II is initiated when you do a PR#1 command--it's only
- true if what you want is where you think it is--and usually it isn't.
-
- An Apple IIe Workstation Card, although recommended for slot 7, can work in
- almost any slot (just like an ImageWriter II can be connected to nearly any
- slot, except maybe slot 3 when the 80-column firmware is active). An Apple
- IIGS with ROM versions 00 or 01 may only have AppleTalk firmware located in
- slot 7. An Apple IIGS with ROM version 03 may only have AppleTalk firmware
- located in either slot 1 or 2.
-
- Before printing through the Super Serial Card emulation to AppleTalk, take the
- same precautions you would take before printing to any slot--check to make sure
- you see the requested slot as a Pascal device before using Pascal entry
- points, and try to look for the signature bytes that indicate the features you
- want are present. In general, avoid hard-coding slot numbers for anything.
-
- ProDOS 8 applications which offer network printing should give users the
- choice of printing to any of the seven slots as well as the Network Printer.
- When Network Printer is selected, the application can find the AppleTalk slot
- by using the 6502 code sample included in this Note. Allowing the selection
- of Network Printer is especially important for applications that keep a
- configuration file containing a user's default printer setup. If an
- application keeps only the slot number in the configuration file, users may
- need to change the printer selection often if they print from several
- different machines (printing to a slot with no firmware generally results in a
- crash).
-
- The code sample uses two methods to find which slot or port the network
- connection should use for transparent printing. The first method works with
- the Apple IIe Workstation card and the ROM 01 Apple IIGS. It looks at the
- AppleTalk completion routine pointer, and if that pointer points to an address
- in slot ROM space, then that slot contains the transparent network printing
- firmware. In other words, if the completion routine points to $0000CnXX,
- where n is between 1 and 7, then n is the slot to be used for transparent
- printing. If the completion routine pointer does not point to slot ROM, then
- the application cannot determine what slot to print through and must query the
- user. The second method works only with the ROM 03 Apple IIGS. It checks two
- Control Panel parameter RAM values to see if AppleTalk is using either serial
- port.
-
- Note: This convention returns a slot number between 1 and 7, which is
- not fully compatible with the Slot Arbiter. When using GS/OS, do
- not pass this number directly to the Slot Arbiter. Refer to Apple
- IIGS Technical Note #69, The Ins and Outs of Slot Arbitration.
-
- This technique applies only to ProDOS 8 programs. Apple IIGS applications
- running under GS/OS should do text printing over the network through the
- Remote Print Manager (RPM) driver, which can be identified by a deviceID of
- $001F as returned from DInfo.
-
- ;
- ; This routine will identify AppleTalk and the slot AppleTalk is associated
- ; with (if possible). This routine is for ProDOS 8 applications only.
- ;
- keep CheckATalk
- longa off
- longi off
- mcopy 2/AInclude/M16.MiscTool
-
- CheckATalk start
- lda #$00
- sta ATalkSlot default to no AppleTalk slot
-
- ; Check for AppleTalk (see AppleTalk Technical Note #1)
-
- jsr $BF00 ProDOS 8 MLI
- dc h'42' $42 command for network calls
- dc a'InfoParams' Parameter list address
- bcs NoATalk no AppleTalk; handle the error
-
- ; Get machine type & ROM version (see Apple II Miscellaneous Technical Note #7)
-
- sec
- jsr $FE1F What kind of machine are we on?
- bcs CheckCom Not a IIGS, check completion address
- cpy #$03
- bcc CheckCom Earlier than ROM 03 IIGS, check
- ; completion address
-
- ROM03 anop ROM 03 or greater IIGS use
- ; parameter RAM to find slot
- clc switch to native mode
- xce
- rep #$30 16 bit m and x
- longa on
- longi on
-
- pea $0000 space for result
- pea $000C port 2 type
- _ReadBParam read parameter RAM
- ; (2 byte result left on stack)
-
- pea $0000 space for result
- pea $0000 port 1 type
- _ReadBParam read parameter RAM
- pla get port 1 setting (2 bytes)
-
-
- sec emulation mode
- xce
- longa off
- longi off
-
- cmp #$02 is port 1 AppleTalk?
- bne TryPort2 no
- inc ATalkSlot yes
- pla remove port 2 setting LSB (1 byte)
- bra NewExit and exit
-
- TryPort2 pla get port 2 setting LSB (1 byte)
- cmp #$02 is port 2 AppleTalk?
- bne NewExit no
- lda #$02 yes
- sta ATalkSlot
-
- NewExit pla remove port 2 setting MSB (1 byte)
- lda ATalkSlot
- beq AskForSlot
- bra HaveSlot
-
- CheckCom anop use completion address to find slot
- lda ComReturn+2 bank $00?
- ora ComReturn+3 high byte = 0?
- bne AskForSlot no, so slot can't be determined
- lda ComReturn+1 get the address page
- cmp #$C8
- bcs AskForSlot greater or equal to $C8 is bad
- cmp #$C1
- bcc AskForSlot less than $C1 is bad
- and #$0F $Cn = $0n
- sta ATalkSlot
-
- HaveSlot anop AppleTalk is installed and is in
- ; slot #ATalkSlot
-
- AskForSlot anop AppleTalk is installed but slot
- ; can't be determined
-
- NoATalk anop AppleTalk is not installed
-
- rts so this sample returns
-
- AtalkSlot entry
- dc h'00' Slot to use for transparent printing
-
- InfoParams dc h'00' Synchronous only
- dc h'02' GetInfo call number
- ds 2 result code
- ComReturn ds 4 completion return address
- ds 8 space for other result info
-
- end
-
-
- Further Reference
- _____________________________________________________________________________
- o AppleShare Programmer's Guide for the Apple IIGS
- o Apple IIGS Technical Note #69, The Ins and Outs of Slot Arbitration
- o Apple II AppleTalk Technical Note #1, Identifying AppleTalk
- o Apple II Miscellaneous Technical Note #7, Apple II Family Identification
- o Apple II Miscellaneous Technical Note #8, Pascal 1.1 Identification Bytes
-
-